package offerv1;

public class Offer05 {

    public String replaceSpace(String s) {
        StringBuilder ret = new StringBuilder();
        int n = s.length();
        for (int i = 0; i < n; i++) {
            char c = s.charAt(i);
            if (c == ' ') {
                ret.append("%20");
            } else {
                ret.append(c);
            }
        }
        return ret.toString();
    }
}
